package com.iflytek.sbd.demo.clone;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.TimeInterval;
import com.google.common.collect.Lists;
import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.function.Consumer;

/**
 * @program: sbd
 * @description:
 * @author: 陈英俊
 * @create: 2022-01-10 17:20
 */
public class Demo {


    /**
     * clone 默认是实现的浅拷贝,深拷贝明天看看
     *
     * @param args
     * @throws CloneNotSupportedException
     */
    public static void main(String[] args) throws CloneNotSupportedException, InterruptedException {

        TimeInterval timer = DateUtil.timer();

//        CloneExample cloneExample = new CloneExample();
//        cloneExample.setA(11);
//        cloneExample.setB(22);
//
//        DeepClone deepClone = new DeepClone();
//        deepClone.setAge(100);
//        deepClone.setCloneExample(cloneExample);
//
//        DeepClone clone = (DeepClone) deepClone.clone();
//        deepClone.getCloneExample().setA(111);
//        deepClone.getCloneExample().setB(222);
//
//        System.out.println(23);
//        Thread.sleep(3000);

//        System.out.println(timer.interval()/1000);
//        Thread.sleep(3000);
//        System.out.println(timer.interval()/1000);
//        String a= "";
//        String b=null;
//        System.out.println(StringUtils.isNotBlank(a));
//        System.out.println(StringUtils.isEmpty(a));
//
//        System.out.println(StringUtils.isNotBlank(b));
//        System.out.println(StringUtils.isNotEmpty(b));
//        ArrayList<Integer> integers = new ArrayList<>();
//        Integer integer = integers.get(0);

//        test(1);
//        System.out.println("main方法");

//        for (int i = 0; i < 4; i++) {
//            if (i == 2) {
//                continue;
//            }
//            System.out.println("当前是第" + i + "次");
//        }
//        System.out.println("循环结束了");

        ArrayList<Integer> list = new ArrayList<>();
//        for (int i = 1; i <= 20000; i++) {
//            list.add(i);
//        }
//        int count=0;
//        for (int x = 0, to=0, size = list.size(); x < size; x = to) {
//            int i = count++;
//            System.out.println("循环第"+i+"次");
//            System.out.println("当前X="+x);
//            System.out.println("操作前 to="+to);
//            to = Math.min(x + 100, size);
//            List<Integer> subList = list.subList(x, to);
//            System.out.println(subList);
//            System.out.println("操作后 to="+to);
//            System.out.println("=========================");
//        }
//        System.out.println("总共循环了"+count+"次");

//        ArrayList<Integer> arrayList = new ArrayList<>();
////        for (int i = 1; i <= 10; i++) {
////            arrayList.add(i);
////        }
//        List<List<Integer>> aa = Lists.partition(arrayList, 3);
//        System.out.println(aa);
        HashMap<String, String> stringStringHashMap = new HashMap<>();
        String ds = stringStringHashMap.get("ds");
        System.out.println(ds);
    }

    private static void test(Integer a) {

        if (a == 1) {
            return;
        }
        System.out.println("小方法");
    }
}